package com.castle.fortress.admin.study.course.mapper;

import com.castle.fortress.admin.study.course.dto.StudyCoursewareDto;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.castle.fortress.admin.study.course.entity.StudyCoursewareEntity;

import java.util.ArrayList;
import java.util.Map;
import java.util.List;
/**
 * 课件管理Mapper 接口
 *
 * @author castle
 * @since 2023-01-30
 */
public interface StudyCoursewareMapper extends BaseMapper<StudyCoursewareEntity> {

	/**
	 * 扩展信息列表
	 * @param pageMap
	 * @param studyCoursewareEntity
	 * @return
	 */
	List<StudyCoursewareEntity> extendsList(@Param("map")Map<String, Long> pageMap, @Param("studyCoursewareEntity") StudyCoursewareEntity studyCoursewareEntity);

	/**
	 * 扩展信息记录总数
	 * @param studyCoursewareEntity
	 * @return
	 */
	Long extendsCount(@Param("studyCoursewareEntity") StudyCoursewareEntity studyCoursewareEntity);

	/**
	 * 课件管理扩展详情
	 * @param id 课件管理id
	 * @return
	 */
    StudyCoursewareEntity getByIdExtends(@Param("id")Long id);

	/**
	 * 查询课程等绑定的课件
	 * @param courseId 课程ID
	 * @param chapterId 章节ID
	 * @return
	 */
	List<StudyCoursewareEntity> selectBycourseId(Long courseId, Long chapterId);

	/**
	 * 查询会员绑定的课件
	 * @param courseId
	 * @param chapterId
	 * @param memberId
	 * @return
	 */
	List<StudyCoursewareEntity> selectStudyListBycourseId(@Param("courseId")Long courseId, @Param("chapterId")Long chapterId,@Param("memberId")Long memberId);
	/**
	 * 查询需要生成图片的文件
	 * @return
	 */
    List<StudyCoursewareEntity> selectToPngList();
	void updatePngNum(@Param("entity") StudyCoursewareEntity entity);

    List<String> findByCoursewareIds(@Param("existIds") ArrayList<Long> existIds);

    void delByClassifyId(@Param("id")Long id);

	List<StudyCoursewareEntity> selectToPngOrPDFList();
}

